﻿// <copyright file="IndexModel.cs" company="Clever Software">
// Copyright (c) 2013, 2014 All Right Reserved, http://www.cleversoftware.by
//
// This source is subject to the Microsoft Permissive License.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// </copyright>
// <author>Clever Software</author>
// <email>info@cleversoftware.by</email>
// <date>2014-02-04</date> 
// <summary>CleverCMS source code</summary>

namespace CleverCMS.Blog.Services.ViewModels
{
    using System;
    using System.Collections.Generic;

    using PagedList;

    using CleverCMS.Blog.Data.Entities;

    /// <summary>
    /// Model for a several <see cref="BlogEntry">BlogEntries</see>.
    /// </summary>
    public class IndexModel
    {
        /// <summary>
        /// Gets or sets the entries.
        /// </summary>
        public IPagedList<BlogEntry> Entries { get; set; }

        /// <summary>
        /// Gets or sets the current page.
        /// </summary>
        public int? CurrentPage { get; set; }

        /// <summary>
        /// Gets or sets the number total pages.
        /// </summary>
        public int TotalPages { get { return this.Entries != null ? this.Entries.PageCount : 0; } }

        /// <summary>
        /// Gets or sets the search term.
        /// </summary>
        public string Search { get; set; }

        /// <summary>
        /// Gets or sets the currently selected tag.
        /// </summary>
        public string Tag { get; set; }

        public string Category { get; set; }

        public string CategoryID { get; set; }

        public IEnumerable<BlogEntryCategory> Categories { get; set; } 

        public IEnumerable<BlogEntry> LatesBlog { get; set; } 

        public IEnumerable<BlogEntryTag> Tags { get; set; } 

        public BlogEntryModel Entry { get; set; }

        public BlogRatingViewModel Rating { get; set; }

        public BlogCommentsViewModel Comments { get; set; }

        public IEnumerable<DateTime> Dates { get; set; } 
    }
}